<script setup lang="ts">
import { ElButton } from 'element-plus'
import { useI18n } from 'vue-i18n'

const i18n = useI18n()

const handleChangeLanguage = (lang: string) => {
  i18n.locale.value = lang
}

const local = window.__env__.local
</script>

<template>
  <div>
    <template v-for="(key, index) in Object.keys(local)" :key="index">
      <ElButton @click="handleChangeLanguage(key)">{{ local[key].name }}</ElButton>
    </template>
  </div>
  <hr />

  <ElButton>{{ $t('el.datepicker.now') }}</ElButton>
  <ElButton>{{ $t('msg.account.accountBtnText') }}</ElButton>
  <ElButton>{{ $t('msg.common.save') }}</ElButton>
  <!-- {{ i18n.messages }} -->
</template>
